UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd6Hw/MsJS8xPcPkT9xt2m7jm8bd69uvrwlN5m5A3N30=' 
WHERE 
  key_id = '2fefaddbfcb041a0c240f3799c21fe0e644d17ee0394b22477b761dfdfb91715' 
  AND (
    token = 'd6Hw/MsJS8xPcPkT9xt2m7jm8bd69uvrwlN5m5A3N30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042