UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZSVj1q4BOFnOHV8q4Ww9y+OY7CW0K1lI71jh93vbcAs=' 
WHERE 
  key_id = '2eed9645a20ed4d293c46c4babe3dee7ac9a717707953372813ce5fe4904ac71' 
  AND (
    token = 'ZSVj1q4BOFnOHV8q4Ww9y+OY7CW0K1lI71jh93vbcAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027