UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bkAfc4ht1OApyc0MK12Q+8yunojXeIUsHM+kcKqUeoQ=' 
WHERE 
  key_id = '5c23ea48c950e7d042b97c40f7aae071eda4158b9d464202cc85e6929e857282' 
  AND (
    token = 'bkAfc4ht1OApyc0MK12Q+8yunojXeIUsHM+kcKqUeoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00090