UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FYJIiRc7RmwBaAzaneJLSJlgC5hshTjaJGURxy7BIAE=' 
WHERE 
  key_id = '5aa4bd2f8f5bdc8b38926bd424a46d030b83549d4baac473caadadf746ce6e95' 
  AND (
    token = 'FYJIiRc7RmwBaAzaneJLSJlgC5hshTjaJGURxy7BIAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029