UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hE9C9lkVFrxxsw/aqhuyQIOHJVZKuZ+S1kWO5ixkJuo=' 
WHERE 
  key_id = 'b2eb203c219167bc21d80460a6a8f887fcc018fc676601987d6863ea1d6dc353' 
  AND (
    token = 'hE9C9lkVFrxxsw/aqhuyQIOHJVZKuZ+S1kWO5ixkJuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054