UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BbahgrhDnHfoR9mlYWmEPFMY6/5kot3Tk5Fol91F+go=' 
WHERE 
  key_id = '1d3990ce20a93ab164cd21f615b3da59ac2c5ba57100cc21d74356f41a53992b' 
  AND (
    token = 'BbahgrhDnHfoR9mlYWmEPFMY6/5kot3Tk5Fol91F+go=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034