UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E4kJK/kdxdOsO1z8LAq3Z6vNl6pQrDb7Lz1VGRgmlDU=' 
WHERE 
  key_id = '426d65d29db0e3c30a0b821e59bdf3542f649abfd722ebdd4acd01b3e2709620' 
  AND (
    token = 'E4kJK/kdxdOsO1z8LAq3Z6vNl6pQrDb7Lz1VGRgmlDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063