UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/bo5HISBuak2UClA7kDKEgpG2abacZZC9YyH+HtzGDY=' 
WHERE 
  key_id = '059e4877633e74d705d1937f96f85cfa3ceb81428ba39e792c6c9b8f8ea231a7' 
  AND (
    token = '/bo5HISBuak2UClA7kDKEgpG2abacZZC9YyH+HtzGDY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027