UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9HlILSf3KoIZ696XsJwwQxZuiOZx3b7PJDQ+NFOxWFI=' 
WHERE 
  key_id = '122dc7097779be86a5aea64150cd49388645a542e00e055450561ab32671f07a' 
  AND (
    token = '9HlILSf3KoIZ696XsJwwQxZuiOZx3b7PJDQ+NFOxWFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021