UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XsSPEyLXYiyLMNdIhK0FB91AeV9/HCuWQ8EJE8LOIcE=' 
WHERE 
  key_id = 'bb59705050fd033b8cbfe354f05223644ff14c87f84ef4d986da97dd13ddfbca' 
  AND (
    token = 'XsSPEyLXYiyLMNdIhK0FB91AeV9/HCuWQ8EJE8LOIcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017