UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wbrn3M5QQRYZmEziGA6g72ghVs39jQIVLkwL55LvE4I=' 
WHERE 
  key_id = '38e8b106d8f918f8f295129ff8d09e13b08384376f5a954db2bb39b9fa123c2e' 
  AND (
    token = 'wbrn3M5QQRYZmEziGA6g72ghVs39jQIVLkwL55LvE4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033