UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/p8TWqoalePxuji8/kXwNYhBm2liHFFWdpOL2TTvcZg=' 
WHERE 
  key_id = '0ecc05f78121cbb032a736f52929513ae3895526eca30f07ff5da0c28193cb85' 
  AND (
    token = '/p8TWqoalePxuji8/kXwNYhBm2liHFFWdpOL2TTvcZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029