UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zj3d1yhTkIvpVGWfvSUmCpuWG1JtCZVE1AZojXSRM5Q=' 
WHERE 
  key_id = 'a4d2cd88c8c19d18cfd65d6b1696f4e9dccaba5acd27b1d1b3c4aa149a09549c' 
  AND (
    token = 'zj3d1yhTkIvpVGWfvSUmCpuWG1JtCZVE1AZojXSRM5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030