UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DFj/mMOPNKSnx+Ci8cmn+DgyiNi2XWxOJSrd4THIZ+U=' 
WHERE 
  key_id = '991ad0b26ef2dbf03c24c5a7db1db0bb171165a70dc36ec328eb75f6738a81cb' 
  AND (
    token = 'DFj/mMOPNKSnx+Ci8cmn+DgyiNi2XWxOJSrd4THIZ+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072