UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mKPlevbzYLUh34i/fLWbSqJcJkiJSN525qA1gfjACC8=' 
WHERE 
  key_id = '70792728a661d7b84bea8c56bd06624ef231efad2e65044d64226ac6516809ea' 
  AND (
    token = 'mKPlevbzYLUh34i/fLWbSqJcJkiJSN525qA1gfjACC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024