UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u5SYDwrnP6DZ3oZHI/Q0bYyFYkqdZS1EkRZQLiA/AUE=' 
WHERE 
  key_id = '7fd347b88f2be6a3b22210cc3045044cd4fc414abd0e11976cabc4e24d335bff' 
  AND (
    token = 'u5SYDwrnP6DZ3oZHI/Q0bYyFYkqdZS1EkRZQLiA/AUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025