UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5QXJsRaqTxsCRnCROe+BKjrGLFj+hT7lkmEl6GTu/Ag=' 
WHERE 
  key_id = 'eabd9a3addacb8e3ea73719c93d24accf47c21163de8b12a98172f0141d79b58' 
  AND (
    token = '5QXJsRaqTxsCRnCROe+BKjrGLFj+hT7lkmEl6GTu/Ag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054