UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b444y2jwDqQ+eUAOiVbb6Lkbxbtj5+YKl0mV4+DcoZo=' 
WHERE 
  key_id = '5fdc5c5c9bbe936599df5caa6388e90b04fc0a0827b4b3cd84578476be5792ef' 
  AND (
    token = 'b444y2jwDqQ+eUAOiVbb6Lkbxbtj5+YKl0mV4+DcoZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034