UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Uzmtrp8xVUQeO+R2KodGmI9Su4vZb/n1wTlBcdoHIc=' 
WHERE 
  key_id = '0c248721dba940dcfd81614acdb0013b2fab565c78f36c9dd77d7d38cfca13c6' 
  AND (
    token = '0Uzmtrp8xVUQeO+R2KodGmI9Su4vZb/n1wTlBcdoHIc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033