UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z8eJqoEXVm8/Y6OL45wswmJY6FhUbq6GQtfNHZ1AVjM=' 
WHERE 
  key_id = '884e8e02b91fbcc2587437ccf4121f9bc0d5688d7451625a43bcffb99468abe3' 
  AND (
    token = 'Z8eJqoEXVm8/Y6OL45wswmJY6FhUbq6GQtfNHZ1AVjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044