UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H3exMY60AeHp/kOdP7YlAuKfFm4zSh73XHpwK7chi04=' 
WHERE 
  key_id = '5eff52ad4fd4dd6ba60022b278f8b2c5efa86457c8e697b9d3c73886c19a00ed' 
  AND (
    token = 'H3exMY60AeHp/kOdP7YlAuKfFm4zSh73XHpwK7chi04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037