UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+s59Z47ObKpVziLvLpd45ECUuQFwaO9hE0TDhDb9Eek=' 
WHERE 
  key_id = '3824e7bfd30cde9e8285260e7b207a6342a509fe8064b71556bd839442b50a73' 
  AND (
    token = '+s59Z47ObKpVziLvLpd45ECUuQFwaO9hE0TDhDb9Eek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036