UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BfMF9JUltz+8Psfb+XYhyp2jI8vqgcykFe9fy909E7I=' 
WHERE 
  key_id = '0668fd8447995bfa04aa5d32aa6ba3c283298acbcf92f3ac04f65ac9d0430c26' 
  AND (
    token = 'BfMF9JUltz+8Psfb+XYhyp2jI8vqgcykFe9fy909E7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060