UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7sL3d0dXokXUhZ/shaR1iE/SS+Wb6wFIMCnMoTrsHlY=' 
WHERE 
  key_id = '88bdc3cce7fbfa7fbe00229d6a5dbbf5deffb0f798315a7133faf9aaf28097c5' 
  AND (
    token = '7sL3d0dXokXUhZ/shaR1iE/SS+Wb6wFIMCnMoTrsHlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026