UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gics7MnIWV32f+PjzVV7Tw12HcGgWytZjSC065bZChc=' 
WHERE 
  key_id = 'da15e6f3fed3b2d823d32b28481ee8815be04e50a47d2b04197ea109c9c4110a' 
  AND (
    token = 'gics7MnIWV32f+PjzVV7Tw12HcGgWytZjSC065bZChc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046