UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ApAowT1wzHgQwCHhSbNt+oGZS+f5PdEEhiLhfrqOn88=' 
WHERE 
  key_id = '75d790e645542ad765bcadccb8db1d3e4c9e7706cee03337a3caba5fda1e6834' 
  AND (
    token = 'ApAowT1wzHgQwCHhSbNt+oGZS+f5PdEEhiLhfrqOn88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042