UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2bDFn8e6OQf7P+Hy/wkenvUS+TLEXDTTxT0aago9CIk=' 
WHERE 
  key_id = 'b4c25bcafadc58b84240af828d633461d7fb4b883eb36c8b218d1dd694e4443f' 
  AND (
    token = '2bDFn8e6OQf7P+Hy/wkenvUS+TLEXDTTxT0aago9CIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027